package member.dao;

import java.sql.SQLException;
import java.util.ArrayList;

import member.vo.MemberVO;
import member.vo.ZipCodeVO;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class MemberDAOImpl extends SqlMapClientDaoSupport implements MemberDAO{

	@Override
	public MemberVO login(MemberVO vo) throws SQLException {
		return (MemberVO) this.getSqlMapClient().queryForObject("mem.login", vo.getMember_id());
	}

	@Override
	public ArrayList<ZipCodeVO> zipCodeSelect(String dong) throws SQLException {
		return (ArrayList<ZipCodeVO>) this.getSqlMapClient().queryForList("mem.zipCodeSelect",dong);
	}

	@Override
	public String checkId(String id) throws SQLException {
		return (String) this.getSqlMapClient().queryForObject("mem.checkId",id);
	}

	@Override
	public void memberJoin(MemberVO vo) throws SQLException {
		this.getSqlMapClient().insert("mem.memberJoin", vo);
	}

	@Override
	public MemberVO serchId(MemberVO vo) throws SQLException {
		return (MemberVO) this.getSqlMapClient().queryForObject("mem.serchId",vo);
	}

	@Override
	public MemberVO sendMail(MemberVO vo) throws SQLException {
		return (MemberVO)this.getSqlMapClient().queryForObject("mem.sendMail", vo);
	}

	@Override
	public int changePassword(MemberVO vo) throws SQLException {
		return this.getSqlMapClient().update("mem.changePassword",vo);
	}

	@Override
	public MemberVO searchPass(MemberVO vo) throws SQLException {
		return (MemberVO)this.getSqlMapClient().queryForObject("mem.searchPass",vo);
	}

	@Override
	public int memberModify(MemberVO vo) throws SQLException {
		return this.getSqlMapClient().update("mem.memberModify",vo);
	}

}
